$OpenBSD: patch-src_libbitdht_src_bitdht_bdquery_cc,v 1.1 2016/03/07 15:25:31 zhuk Exp $
Fix time_t issues.
--- src/libbitdht/src/bitdht/bdquery.cc.orig	Mon Mar  7 16:53:58 2016
+++ src/libbitdht/src/bitdht/bdquery.cc	Mon Mar  7 17:03:57 2016
@@ -966,7 +966,7 @@ int     bdQuery::printQuery()
 	fprintf(stderr, "Query for: ");
 	mFns->bdPrintNodeId(std::cerr, &mId);
 	fprintf(stderr, " Query State: %d", mState);
-	fprintf(stderr, " Query Age %ld secs", ts-mQueryTS);
+	fprintf(stderr, " Query Age %lld secs", (long long)ts-mQueryTS);
 	if (mState >= BITDHT_QUERY_FAILURE)
 	{
 		fprintf(stderr, " Search Time: %d secs", mSearchTime);
@@ -982,9 +982,9 @@ int     bdQuery::printQuery()
 		mFns->bdPrintId(std::cerr, &(it->second.mPeerId));
 		fprintf(stderr, "  Bucket: %d ", mFns->bdBucketDistance(&(it->first)));
 		fprintf(stderr," Flags: %x", it->second.mPeerFlags);
-		fprintf(stderr," Found: %ld ago", ts-it->second.mFoundTime);
-		fprintf(stderr," LastSent: %ld ago", ts-it->second.mLastSendTime);
-		fprintf(stderr," LastRecv: %ld ago", ts-it->second.mLastRecvTime);
+		fprintf(stderr," Found: %lld ago", (long long)ts-it->second.mFoundTime);
+		fprintf(stderr," LastSent: %lld ago", (long long)ts-it->second.mLastSendTime);
+		fprintf(stderr," LastRecv: %lld ago", (long long)ts-it->second.mLastRecvTime);
 		fprintf(stderr, "\n");
 	}
 
@@ -995,9 +995,9 @@ int     bdQuery::printQuery()
 		mFns->bdPrintId(std::cerr, &(it->second.mPeerId));
 		fprintf(stderr, "  Bucket: %d ", mFns->bdBucketDistance(&(it->first)));
 		fprintf(stderr," Flags: %x", it->second.mPeerFlags);
-		fprintf(stderr," Found: %ld ago", ts-it->second.mFoundTime);
-		fprintf(stderr," LastSent: %ld ago", ts-it->second.mLastSendTime);
-		fprintf(stderr," LastRecv: %ld ago", ts-it->second.mLastRecvTime);
+		fprintf(stderr," Found: %lld ago", (long long)ts-it->second.mFoundTime);
+		fprintf(stderr," LastSent: %lld ago", (long long)ts-it->second.mLastSendTime);
+		fprintf(stderr," LastRecv: %lld ago", (long long)ts-it->second.mLastRecvTime);
 		fprintf(stderr, "\n");
 	}
 #else
@@ -1009,9 +1009,9 @@ int     bdQuery::printQuery()
 		mFns->bdPrintId(std::cerr, &(it->second.mPeerId));
 		fprintf(stderr, "  Bucket: %d ", mFns->bdBucketDistance(&(it->first)));
 		fprintf(stderr," Flags: %x", it->second.mPeerFlags);
-		fprintf(stderr," Found: %ld ago", ts-it->second.mFoundTime);
-		fprintf(stderr," LastSent: %ld ago", ts-it->second.mLastSendTime);
-		fprintf(stderr," LastRecv: %ld ago", ts-it->second.mLastRecvTime);
+		fprintf(stderr," Found: %lld ago", (long long)ts-it->second.mFoundTime);
+		fprintf(stderr," LastSent: %lld ago", (long long)ts-it->second.mLastSendTime);
+		fprintf(stderr," LastRecv: %lld ago", (long long)ts-it->second.mLastRecvTime);
 	}
 	fprintf(stderr, "\n");
 
@@ -1022,9 +1022,9 @@ int     bdQuery::printQuery()
 		mFns->bdPrintId(std::cerr, &(it->second.mPeerId));
 		fprintf(stderr, "  Bucket: %d ", mFns->bdBucketDistance(&(it->first)));
 		fprintf(stderr," Flags: %x", it->second.mPeerFlags);
-		fprintf(stderr," Found: %ld ago", ts-it->second.mFoundTime);
-		fprintf(stderr," LastSent: %ld ago", ts-it->second.mLastSendTime);
-		fprintf(stderr," LastRecv: %ld ago", ts-it->second.mLastRecvTime);
+		fprintf(stderr," Found: %lld ago", (long long)ts-it->second.mFoundTime);
+		fprintf(stderr," LastSent: %lld ago", (long long)ts-it->second.mLastSendTime);
+		fprintf(stderr," LastRecv: %lld ago", (long long)ts-it->second.mLastRecvTime);
 	}
 	fprintf(stderr, "\n");
 
@@ -1036,9 +1036,9 @@ int     bdQuery::printQuery()
 		fprintf(stderr, "ProxyId:  ");
 		mFns->bdPrintId(std::cerr, &(lit->mPeerId));
 		fprintf(stderr," Flags: %x", it->second.mPeerFlags);
-		fprintf(stderr," Found: %ld ago", ts-lit->mFoundTime);
-		fprintf(stderr," LastSent: %ld ago", ts-lit->mLastSendTime);
-		fprintf(stderr," LastRecv: %ld ago", ts-lit->mLastRecvTime);
+		fprintf(stderr," Found: %lld ago", (long long)ts-lit->mFoundTime);
+		fprintf(stderr," LastSent: %lld ago", (long long)ts-lit->mLastSendTime);
+		fprintf(stderr," LastRecv: %lld ago", (long long)ts-lit->mLastRecvTime);
 		fprintf(stderr, "\n");
 	}
 	
@@ -1048,9 +1048,9 @@ int     bdQuery::printQuery()
 		fprintf(stderr, "ProxyId:  ");
 		mFns->bdPrintId(std::cerr, &(lit->mPeerId));
 		fprintf(stderr," Flags: %x", it->second.mPeerFlags);
-		fprintf(stderr," Found: %ld ago", ts-lit->mFoundTime);
-		fprintf(stderr," LastSent: %ld ago", ts-lit->mLastSendTime);
-		fprintf(stderr," LastRecv: %ld ago", ts-lit->mLastRecvTime);
+		fprintf(stderr," Found: %lld ago", (long long)ts-lit->mFoundTime);
+		fprintf(stderr," LastSent: %lld ago", (long long)ts-lit->mLastSendTime);
+		fprintf(stderr," LastRecv: %lld ago", (long long)ts-lit->mLastRecvTime);
 		fprintf(stderr, "\n");
 	}
 
